package com.foreknow.elmboot.service;

import com.foreknow.elmboot.po.Cart;

import java.util.List;


public interface CartService {
    /**
     * 根据UserId查询购物车情况
     * @param userId
     * @return
     */
    public List<Cart> getCartByUserId(String userId);

    /**
     * 根据UserId和BusinessId查询此用户购物车中某个商家的所有购物车信息
     * @param userId
     * @param businessId
     * @return
     */
    public List<Cart> listCart(String userId,Integer businessId);

    /**
     * 向购物车表中添加一条记录
     * @param foodId
     * @param businessId
     * @param userId
     * @param quantity
     * @return
     */
    public int saveCart(Integer foodId,Integer businessId,String userId,Integer quantity);

    /**
     * 根据UserId、BusinessId、FoodId更新Quantity
     * @param foodId
     * @param businessId
     * @param userId
     * @param quantity
     * @return
     */
    public int updateCart(Integer foodId,Integer businessId,String userId,Integer quantity);

    /**
     * 根据UserId、BusinessId、FoodId删除购物车表中的一条食品记录
     * @param foodId
     * @param businessId
     * @param userId
     * @return
     */
    public int removeFood(Integer foodId,Integer businessId,String userId);

    /**
     * 根据UserId、BusinessId删除购物车表中的多条记录
     * @param businessId
     * @param userId
     * @return
     */
    public int removeCart(Integer businessId,String userId);
}
